//
//  LBBuyCardetailsFootCell.m
//  loveBeen
//
//  Created by 杨烁 on 2016/11/20.
//  Copyright © 2016年 loveBeen. All rights reserved.
//

#import "LBBuyCardetailsFootCell.h"
#import "LBOrderRemarkController.h"

@implementation LBBuyCardetailsFootCell


-(void)awakeFromNib{
    
    [super awakeFromNib];
    
    
}

-(void)setSelected:(BOOL)selected{
    _selected = selected;
     self.selecBtn.selected = self.selected;
    
}

-(void)setLb_msg:(UILabel *)lb_msg{
    
    if (![LBPlusMinusTool sharedPlusMinusTool].os) {
         lb_msg.text = @"其他要求   (如带红塔山一盒)";
    }
    
    lb_msg.text = [LBPlusMinusTool sharedPlusMinusTool].os;
    
    
}

- (IBAction)allSeledted:(UIButton *)sender {
    
    sender.selected = !sender.selected;
    
    [LBPlusMinusTool sharedPlusMinusTool].allSelected = sender.selected;
    
    self.selected = sender.selected;
//    self.selected = sender.selected;
    NSArray<LBSuperMarketProducts *> *array=[LBPlusMinusTool sharedPlusMinusTool].selectedProductsModel;
        
       
        [array enumerateObjectsUsingBlock:^(LBSuperMarketProducts * _Nonnull model, NSUInteger idx, BOOL * _Nonnull stop) {
           
            model.selected = sender.selected;
        }];
    NSLog(@"%@",array);
    
//    [[NSNotificationCenter defaultCenter]postNotificationName:@"refrash" object:self];
    
    [[LBPlusMinusTool sharedPlusMinusTool]fastUpdate:self];
}



//实现有一些问题.需要改动
- (IBAction)click:(UIButton *)sender {
    
    if([self.delegate respondsToSelector:@selector(PushPay:)]){
        
        [self.delegate PushPay:self];
    }
       
}



@end
